<!--<template>-->
<!--  <div class="app-container">-->
<!--    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">-->
<!--      <el-form-item label="供应商名称" prop="supplierName">-->
<!--        <el-input-->
<!--          v-model="queryParams.supplierName"-->
<!--          placeholder="请输入供应商名称"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="供应商分类" prop="type">-->
<!--        <el-select v-model="queryParams.type" placeholder="请选择供应商分类" clearable size="small">-->
<!--          <el-option label="请选择字典生成" value="" />-->
<!--        </el-select>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="供应商区域" prop="region">-->
<!--        <el-input-->
<!--          v-model="queryParams.region"-->
<!--          placeholder="请输入供应商区域"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="供应商详细地址" prop="adress">-->
<!--        <el-input-->
<!--          v-model="queryParams.adress"-->
<!--          placeholder="请输入供应商详细地址"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="联系人姓名" prop="relName">-->
<!--        <el-input-->
<!--          v-model="queryParams.relName"-->
<!--          placeholder="请输入联系人姓名"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="联系方式" prop="userPhone">-->
<!--        <el-input-->
<!--          v-model="queryParams.userPhone"-->
<!--          placeholder="请输入联系方式"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="供应商状态" prop="status">-->
<!--        <el-select v-model="queryParams.status" placeholder="请选择供应商状态" clearable size="small">-->
<!--          <el-option label="请选择字典生成" value="" />-->
<!--        </el-select>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="联系人职位" prop="position">-->
<!--        <el-input-->
<!--          v-model="queryParams.position"-->
<!--          placeholder="请输入联系人职位"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="更新者" prop="updateUser">-->
<!--        <el-input-->
<!--          v-model="queryParams.updateUser"-->
<!--          placeholder="请输入更新者"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="创建者" prop="createUser">-->
<!--        <el-input-->
<!--          v-model="queryParams.createUser"-->
<!--          placeholder="请输入创建者"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="电子邮件" prop="email">-->
<!--        <el-input-->
<!--          v-model="queryParams.email"-->
<!--          placeholder="请输入电子邮件"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="邮编" prop="zipNo">-->
<!--        <el-input-->
<!--          v-model="queryParams.zipNo"-->
<!--          placeholder="请输入邮编"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="发票排头" prop="invoiceHeader">-->
<!--        <el-input-->
<!--          v-model="queryParams.invoiceHeader"-->
<!--          placeholder="请输入发票排头"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="纳税人识别号" prop="taxpayerId">-->
<!--        <el-input-->
<!--          v-model="queryParams.taxpayerId"-->
<!--          placeholder="请输入纳税人识别号"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="开户名称" prop="accountName">-->
<!--        <el-input-->
<!--          v-model="queryParams.accountName"-->
<!--          placeholder="请输入开户名称"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="银行账号" prop="bankAccount">-->
<!--        <el-input-->
<!--          v-model="queryParams.bankAccount"-->
<!--          placeholder="请输入银行账号"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="标识客户1供货商2" prop="mark">-->
<!--        <el-input-->
<!--          v-model="queryParams.mark"-->
<!--          placeholder="请输入标识客户1供货商2"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item>-->
<!--        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
<!--        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
<!--      </el-form-item>-->
<!--    </el-form>-->

<!--    <el-row :gutter="10" class="mb8">-->
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="primary"-->
<!--          plain-->
<!--          icon="el-icon-plus"-->
<!--          size="mini"-->
<!--          @click="handleAdd"-->
<!--          v-hasPermi="['system:suppliee:add']"-->
<!--        >新增</el-button>-->
<!--      </el-col>-->
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="success"-->
<!--          plain-->
<!--          icon="el-icon-edit"-->
<!--          size="mini"-->
<!--          :disabled="single"-->
<!--          @click="handleUpdate"-->
<!--          v-hasPermi="['system:suppliee:edit']"-->
<!--        >修改</el-button>-->
<!--      </el-col>-->
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="danger"-->
<!--          plain-->
<!--          icon="el-icon-delete"-->
<!--          size="mini"-->
<!--          :disabled="multiple"-->
<!--          @click="handleDelete"-->
<!--          v-hasPermi="['system:suppliee:remove']"-->
<!--        >删除</el-button>-->
<!--      </el-col>-->
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="warning"-->
<!--          plain-->
<!--          icon="el-icon-download"-->
<!--          size="mini"-->
<!--          :loading="exportLoading"-->
<!--          @click="handleExport"-->
<!--          v-hasPermi="['system:suppliee:export']"-->
<!--        >导出</el-button>-->
<!--      </el-col>-->
<!--      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!--    </el-row>-->

<!--    <el-table v-loading="loading" :data="supplieeList" @selection-change="handleSelectionChange">-->
<!--      <el-table-column type="selection" width="55" align="center" />-->
<!--      <el-table-column label="供应商名称" align="center" prop="supplierName" />-->
<!--      <el-table-column label="主键id" align="center" prop="supplierId" />-->
<!--      <el-table-column label="供应商编码" align="center" prop="code" />-->
<!--      <el-table-column label="供应商分类" align="center" prop="type" />-->
<!--      <el-table-column label="供应商区域" align="center" prop="region" />-->
<!--      <el-table-column label="供应商详细地址" align="center" prop="adress" />-->
<!--      <el-table-column label="供应商备注" align="center" prop="remark" />-->
<!--      <el-table-column label="联系人姓名" align="center" prop="relName" />-->
<!--      <el-table-column label="联系方式" align="center" prop="userPhone" />-->
<!--      <el-table-column label="供应商状态" align="center" prop="status" />-->
<!--      <el-table-column label="联系人职位" align="center" prop="position" />-->
<!--      <el-table-column label="更新者" align="center" prop="updateUser" />-->
<!--      <el-table-column label="创建者" align="center" prop="createUser" />-->
<!--      <el-table-column label="电子邮件" align="center" prop="email" />-->
<!--      <el-table-column label="邮编" align="center" prop="zipNo" />-->
<!--      <el-table-column label="发票排头" align="center" prop="invoiceHeader" />-->
<!--      <el-table-column label="纳税人识别号" align="center" prop="taxpayerId" />-->
<!--      <el-table-column label="开户名称" align="center" prop="accountName" />-->
<!--      <el-table-column label="银行账号" align="center" prop="bankAccount" />-->
<!--      <el-table-column label="标识客户1供货商2" align="center" prop="mark" />-->
<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!--        <template slot-scope="scope">-->
<!--          <el-button-->
<!--            size="mini"-->
<!--            type="text"-->
<!--            icon="el-icon-edit"-->
<!--            @click="handleUpdate(scope.row)"-->
<!--            v-hasPermi="['system:suppliee:edit']"-->
<!--          >修改</el-button>-->
<!--          <el-button-->
<!--            size="mini"-->
<!--            type="text"-->
<!--            icon="el-icon-delete"-->
<!--            @click="handleDelete(scope.row)"-->
<!--            v-hasPermi="['system:suppliee:remove']"-->
<!--          >删除</el-button>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--    </el-table>-->
<!--    -->
<!--    <pagination-->
<!--      v-show="total>0"-->
<!--      :total="total"-->
<!--      :page.sync="queryParams.pageNum"-->
<!--      :limit.sync="queryParams.pageSize"-->
<!--      @pagination="getList"-->
<!--    />-->

<!--    &lt;!&ndash; 添加或修改供应商信息对话框 &ndash;&gt;-->
<!--    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
<!--      <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
<!--        <el-form-item label="供应商名称" prop="supplierName">-->
<!--          <el-input v-model="form.supplierName" placeholder="请输入供应商名称" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="供应商分类" prop="type">-->
<!--          <el-select v-model="form.type" placeholder="请选择供应商分类">-->
<!--            <el-option label="请选择字典生成" value="" />-->
<!--          </el-select>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="供应商区域" prop="region">-->
<!--          <el-input v-model="form.region" placeholder="请输入供应商区域" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="供应商详细地址" prop="adress">-->
<!--          <el-input v-model="form.adress" placeholder="请输入供应商详细地址" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="供应商备注" prop="remark">-->
<!--          <el-input v-model="form.remark" placeholder="请输入供应商备注" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="联系人姓名" prop="relName">-->
<!--          <el-input v-model="form.relName" placeholder="请输入联系人姓名" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="联系方式" prop="userPhone">-->
<!--          <el-input v-model="form.userPhone" placeholder="请输入联系方式" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="供应商状态">-->
<!--          <el-radio-group v-model="form.status">-->
<!--            <el-radio label="1">请选择字典生成</el-radio>-->
<!--          </el-radio-group>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="联系人职位" prop="position">-->
<!--          <el-input v-model="form.position" placeholder="请输入联系人职位" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="更新者" prop="updateUser">-->
<!--          <el-input v-model="form.updateUser" placeholder="请输入更新者" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="创建者" prop="createUser">-->
<!--          <el-input v-model="form.createUser" placeholder="请输入创建者" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="电子邮件" prop="email">-->
<!--          <el-input v-model="form.email" placeholder="请输入电子邮件" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="邮编" prop="zipNo">-->
<!--          <el-input v-model="form.zipNo" placeholder="请输入邮编" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="发票排头" prop="invoiceHeader">-->
<!--          <el-input v-model="form.invoiceHeader" placeholder="请输入发票排头" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="纳税人识别号" prop="taxpayerId">-->
<!--          <el-input v-model="form.taxpayerId" placeholder="请输入纳税人识别号" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="开户名称" prop="accountName">-->
<!--          <el-input v-model="form.accountName" placeholder="请输入开户名称" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="银行账号" prop="bankAccount">-->
<!--          <el-input v-model="form.bankAccount" placeholder="请输入银行账号" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="标识客户1供货商2" prop="mark">-->
<!--          <el-input v-model="form.mark" placeholder="请输入标识客户1供货商2" />-->
<!--        </el-form-item>-->
<!--      </el-form>-->
<!--      <div slot="footer" class="dialog-footer">-->
<!--        <el-button type="primary" @click="submitForm">确 定</el-button>-->
<!--        <el-button @click="cancel">取 消</el-button>-->
<!--      </div>-->
<!--    </el-dialog>-->
<!--  </div>-->
<!--</template>-->

<!--<script>-->
<!--import { listSuppliee, getSuppliee, delSuppliee, addSuppliee, updateSuppliee, exportSuppliee } from "@/api/system/suppliee";-->

<!--export default {-->
<!--  name: "Suppliee",-->
<!--  data() {-->
<!--    return {-->
<!--      // 遮罩层-->
<!--      loading: true,-->
<!--      // 导出遮罩层-->
<!--      exportLoading: false,-->
<!--      // 选中数组-->
<!--      ids: [],-->
<!--      // 非单个禁用-->
<!--      single: true,-->
<!--      // 非多个禁用-->
<!--      multiple: true,-->
<!--      // 显示搜索条件-->
<!--      showSearch: true,-->
<!--      // 总条数-->
<!--      total: 0,-->
<!--      // 供应商信息表格数据-->
<!--      supplieeList: [],-->
<!--      // 弹出层标题-->
<!--      title: "",-->
<!--      // 是否显示弹出层-->
<!--      open: false,-->
<!--      // 查询参数-->
<!--      queryParams: {-->
<!--        pageNum: 1,-->
<!--        pageSize: 10,-->
<!--        supplierName: null,-->
<!--        type: null,-->
<!--        region: null,-->
<!--        adress: null,-->
<!--        relName: null,-->
<!--        userPhone: null,-->
<!--        status: null,-->
<!--        position: null,-->
<!--        updateUser: null,-->
<!--        createUser: null,-->
<!--        email: null,-->
<!--        zipNo: null,-->
<!--        invoiceHeader: null,-->
<!--        taxpayerId: null,-->
<!--        accountName: null,-->
<!--        bankAccount: null,-->
<!--        mark: null-->
<!--      },-->
<!--      // 表单参数-->
<!--      form: {},-->
<!--      // 表单校验-->
<!--      rules: {-->
<!--      }-->
<!--    };-->
<!--  },-->
<!--  created() {-->
<!--    this.getList();-->
<!--  },-->
<!--  methods: {-->
<!--    /** 查询供应商信息列表 */-->
<!--    getList() {-->
<!--      this.loading = true;-->
<!--      listSuppliee(this.queryParams).then(response => {-->
<!--        this.supplieeList = response.rows;-->
<!--        this.total = response.total;-->
<!--        this.loading = false;-->
<!--      });-->
<!--    },-->
<!--    // 取消按钮-->
<!--    cancel() {-->
<!--      this.open = false;-->
<!--      this.reset();-->
<!--    },-->
<!--    // 表单重置-->
<!--    reset() {-->
<!--      this.form = {-->
<!--        supplierName: null,-->
<!--        supplierId: null,-->
<!--        code: null,-->
<!--        type: null,-->
<!--        region: null,-->
<!--        adress: null,-->
<!--        remark: null,-->
<!--        relName: null,-->
<!--        userPhone: null,-->
<!--        status: "0",-->
<!--        position: null,-->
<!--        createTime: null,-->
<!--        updateUser: null,-->
<!--        updateTime: null,-->
<!--        createUser: null,-->
<!--        email: null,-->
<!--        zipNo: null,-->
<!--        invoiceHeader: null,-->
<!--        taxpayerId: null,-->
<!--        accountName: null,-->
<!--        bankAccount: null,-->
<!--        mark: null-->
<!--      };-->
<!--      this.resetForm("form");-->
<!--    },-->
<!--    /** 搜索按钮操作 */-->
<!--    handleQuery() {-->
<!--      this.queryParams.pageNum = 1;-->
<!--      this.getList();-->
<!--    },-->
<!--    /** 重置按钮操作 */-->
<!--    resetQuery() {-->
<!--      this.resetForm("queryForm");-->
<!--      this.handleQuery();-->
<!--    },-->
<!--    // 多选框选中数据-->
<!--    handleSelectionChange(selection) {-->
<!--      this.ids = selection.map(item => item.supplierId)-->
<!--      this.single = selection.length!==1-->
<!--      this.multiple = !selection.length-->
<!--    },-->
<!--    /** 新增按钮操作 */-->
<!--    handleAdd() {-->
<!--      this.reset();-->
<!--      this.open = true;-->
<!--      this.title = "添加供应商信息";-->
<!--    },-->
<!--    /** 修改按钮操作 */-->
<!--    handleUpdate(row) {-->
<!--      this.reset();-->
<!--      const supplierId = row.supplierId || this.ids-->
<!--      getSuppliee(supplierId).then(response => {-->
<!--        this.form = response.data;-->
<!--        this.open = true;-->
<!--        this.title = "修改供应商信息";-->
<!--      });-->
<!--    },-->
<!--    /** 提交按钮 */-->
<!--    submitForm() {-->
<!--      this.$refs["form"].validate(valid => {-->
<!--        if (valid) {-->
<!--          if (this.form.supplierId != null) {-->
<!--            updateSuppliee(this.form).then(response => {-->
<!--              this.$modal.msgSuccess("修改成功");-->
<!--              this.open = false;-->
<!--              this.getList();-->
<!--            });-->
<!--          } else {-->
<!--            addSuppliee(this.form).then(response => {-->
<!--              this.$modal.msgSuccess("新增成功");-->
<!--              this.open = false;-->
<!--              this.getList();-->
<!--            });-->
<!--          }-->
<!--        }-->
<!--      });-->
<!--    },-->
<!--    /** 删除按钮操作 */-->
<!--    handleDelete(row) {-->
<!--      const supplierIds = row.supplierId || this.ids;-->
<!--      this.$modal.confirm('是否确认删除供应商信息编号为"' + supplierIds + '"的数据项？').then(function() {-->
<!--        return delSuppliee(supplierIds);-->
<!--      }).then(() => {-->
<!--        this.getList();-->
<!--        this.$modal.msgSuccess("删除成功");-->
<!--      }).catch(() => {});-->
<!--    },-->
<!--    /** 导出按钮操作 */-->
<!--    handleExport() {-->
<!--      const queryParams = this.queryParams;-->
<!--      this.$modal.confirm('是否确认导出所有供应商信息数据项？').then(() => {-->
<!--        this.exportLoading = true;-->
<!--        return exportSuppliee(queryParams);-->
<!--      }).then(response => {-->
<!--        this.$download.name(response.msg);-->
<!--        this.exportLoading = false;-->
<!--      }).catch(() => {});-->
<!--    }-->
<!--  }-->
<!--};-->
<!--</script>-->
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="74px">
      <el-form-item label="供应商名称" prop="supplierName" label-width="85px">
        <el-input
          v-model="queryParams.supplierName"
          placeholder="请输入供应商名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
          style="width: 150px"
        />
      </el-form-item>
      <el-form-item label="供应商分类" prop="type" label-width="85px">
        <el-select v-model="queryParams.type" placeholder="请选择供应商分类"  clearable size="small">
          <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label"
                     :value="item.value" :disabled="item.disabled"  style="width: 150px"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="供应商区域" prop="region" label-width="85px">
        <el-input
          v-model="queryParams.region"
          placeholder="请输入供应商区域"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
          style="width: 150px"
        />
      </el-form-item>
      <el-form-item label="供应商状态" prop="status" label-width="85px">
        <el-select v-model="queryParams.status" placeholder="请选择供应商状态" clearable size="small">
          <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.label"
                     :value="item.value" :disabled="item.disabled"  style="width: 150px"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" style="margin-left: 25px">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:suppliee:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:suppliee:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:suppliee:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleExport"
          v-hasPermi="['system:suppliee:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="supplieeList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="供应商名称" align="center" prop="supplierName" />
      <el-table-column label="供应商编号" align="center" prop="code" />
      <el-table-column label="供应商分类" align="center" prop="type" />
      <el-table-column label="供应商区域" align="center" prop="region" />
      <el-table-column label="联系人姓名" align="center" prop="relName" />
      <el-table-column label="联系方式" align="center" prop="userPhone" />
      <el-table-column label="供应商状态" align="center" prop="status" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:suppliee:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:suppliee:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改供应商信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="75px" style="font-family:楷体;margin-top: -10px">
        <div style="height:30px;border-bottom:1px solid #f2f2f2;width: 900px;margin: 0 5px 10px"><p style="font-size: 18px;margin-left: 5px;font-weight: bold;border-left: #006eff 5px solid;padding-left: 10px">基础信息</p></div>
        <div style="width: 900px;margin: 0 auto;margin-left:10px;display: inline-block">
          <el-form-item label="供应商名称" prop="supplierName" label-width="110px" style="float: left">
            <el-input v-model="form.supplierName" placeholder="请输入供应商名称" style="width: 170px" />
          </el-form-item>
          <el-form-item label="供应商编号" prop="code" label-width="110px" style="float: left">
            <el-input v-model="form.code" placeholder="请输入供应商编号" style="width: 170px" />
          </el-form-item>
          <el-form-item label="供应商分类" prop="type" label-width="110px" style="float: left">
            <el-select v-model="form.type" placeholder="请选择供应商分类">
              <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label"
                         :value="item.value" :disabled="item.disabled" style="width: 170px"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="供应商区域" prop="region" label-width="110px" style="float: left">
            <el-input v-model="form.region" placeholder="请输入供应商区域" style="width: 450px" />
          </el-form-item>
          <el-form-item label="供应商备注" prop="remark" label-width="110px" style="float: left">
            <el-input v-model="form.remark" placeholder="请输入供应商备注"  style="width: 210px"/>
          </el-form-item>
          <el-form-item label="供应商详细地址" prop="adress" label-width="110px" style="float: left">
            <el-input v-model="form.adress" placeholder="请输入供应商详细地址" style="width: 450px" />
          </el-form-item>
          <el-form-item label="供应商状态" label-width="110px" style="float: left">
            <el-switch v-model="form.status"></el-switch>
          </el-form-item>
        </div>
        <div style="height:30px;border-bottom:1px solid #f2f2f2;width: 900px;margin: 0 5px 10px"><p style="font-size: 18px;margin-left: 5px;font-weight: bold;border-left: #006eff 5px solid;padding-left: 10px">联系人信息</p></div>
        <div style="width: 900px;margin: 0 auto;margin-left:10px;display: inline-block">
          <el-form-item label="联系人姓名" prop="relName" label-width="110px" style="float: left">
            <el-input v-model="form.relName" placeholder="请输入联系人姓名" style="width: 170px" />
          </el-form-item>
          <el-form-item label="联系方式" prop="userPhone" label-width="110px" style="float: left">
            <el-input v-model="form.userPhone" placeholder="请输入联系方式" style="width: 170px" />
          </el-form-item>
          <el-form-item label="联系人职位" prop="position" label-width="110px" style="float: left">
            <el-input v-model="form.position" placeholder="请输入联系人职位" style="width: 170px" />
          </el-form-item>
          <el-form-item label="电子邮件" prop="email" label-width="110px" style="float: left">
            <el-input v-model="form.email" placeholder="请输入电子邮件" style="width: 170px" />
          </el-form-item>
          <el-form-item label="邮编" prop="zipNo" label-width="110px" style="float: left">
            <el-input v-model="form.zipNo" placeholder="请输入邮编" style="width: 170px" />
          </el-form-item>
        </div>
        <div style="height:30px;border-bottom:1px solid #f2f2f2;width: 900px;margin: 0 5px 10px"><p style="font-size: 18px;margin-left: 5px;font-weight: bold;border-left: #006eff 5px solid;padding-left: 10px">财务信息</p></div>
        <div style="width: 900px;margin: 0 auto;margin-left:10px;display: inline-block">
<!--          <el-form-item label="更新者" prop="updateUser" label-width="110px" style="float: left">-->
<!--            <el-input v-model="form.updateUser" placeholder="请输入更新者" style="width: 170px" />-->
<!--          </el-form-item>-->
<!--          <el-form-item label="创建者" prop="createUser" label-width="110px" style="float: left">-->
<!--            <el-input v-model="form.createUser" placeholder="请输入创建者" style="width: 170px" />-->
<!--          </el-form-item>-->
          <el-form-item label="发票排头" prop="invoiceHeader" label-width="110px" style="float: left">
            <el-input v-model="form.invoiceHeader" placeholder="请输入发票排头" style="width: 170px" />
          </el-form-item>
          <el-form-item label="纳税人识别号" prop="taxpayerId" label-width="110px" style="float: left">
            <el-input v-model="form.taxpayerId" placeholder="请输入纳税人识别号" style="width: 170px" />
          </el-form-item>
          <el-form-item label="开户名称" prop="accountName" label-width="110px" style="float: left">
            <el-input v-model="form.accountName" placeholder="请输入开户名称" style="width: 170px" />
          </el-form-item>
          <el-form-item label="银行账号" prop="bankAccount" label-width="110px" style="float: left">
            <el-input v-model="form.bankAccount" placeholder="请输入银行账号" style="width: 170px" />
          </el-form-item>
        </div>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listSuppliee, getSuppliee, delSuppliee, addSuppliee, updateSuppliee, exportSuppliee } from "@/api/system/suppliee";

export default {
  name: "Supplier",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 供应商信息表格数据
      supplieeList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        supplierName: null,
        code: null,
        type: null,
        region: null,
        adress: null,
        relName: null,
        userPhone: null,
        status: null,
        position: null,
        updateUser: null,
        createUser: null,
        email: null,
        zipNo: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        supplierName:[
          {required: true, message: "供应商名称不能为空", trigger: "blur" }
        ],
        type:[
          {required: true, message: "供应商分类不能为空", trigger: "blur" },
          {required:true,message:"请选择供应商分类",trigger:'change'}
        ],
        relName:[{required: true, message: "联系人姓名不能为空", trigger: "blur"}]
        ,
        userPhone:[{required: true, message: "联系方式不能为空", trigger: "blur"},{ required: true,
          pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
          message: "请输入正确的手机号码",
          trigger: "blur"}]
      },
      typeOptions:[{
        "label":"分类一",
        "value":1
      },
        {
          "label":"分类二",
          "value":2
        },
        {
          "label":"分类三",
          "value":3
        }],
      statusOptions:[{
        "label":"true",
        "value":true
      },
        {
          "label":"false",
          "value":false
        }]
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询供应商信息列表 */
    getList() {
      this.loading = true;
      listSuppliee(this.queryParams).then(response => {
        this.supplieeList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        supplierId: null,
        supplierName: null,
        code: null,
        type: null,
        region: null,
        adress: null,
        remark: null,
        relName: null,
        userPhone: null,
        status: "0",
        position: null,
        createTime: null,
        updateUser: null,
        updateTime: null,
        createUser: null,
        email: null,
        zipNo: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.supplierId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加供应商信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const supplierId = row.supplierId || this.ids
      getSuppliee(supplierId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改供应商信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.supplierId != null) {
            updateSuppliee(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSuppliee(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const supplierIds = row.supplierId || this.ids;
      this.$modal.confirm('是否确认删除供应商信息编号为"' + supplierIds + '"的数据项？').then(function() {
        return delSuppliee(supplierIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$modal.confirm('是否确认导出所有供应商信息数据项？').then(() => {
        this.exportLoading = true;
        return exportSuppliee(queryParams);
      }).then(response => {
        this.$download.name(response.msg);
        this.exportLoading = false;
      }).catch(() => {});
    }
  }
};
</script>
